package cn.iocoder.yudao.module.crossborder.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 跨境电商履约状态枚举
 *
 * @author LHL
 */
@AllArgsConstructor
@Getter
public enum FulfillmentStatusEnum {

    PENDING(10, "待处理"),
    PREPARING(20, "备货中"),
    ALLOCATED(30, "已分配"),
    PICKING(40, "拣货中"),
    PICKED(50, "已拣货"),
    PACKED(60, "已打包"),
    SHIPPED(70, "已发货"),
    IN_TRANSIT(80, "运输中"),
    DELIVERED(90, "已送达"),
    ;

    /**
     * 状态值
     */
    private final Integer status;
    
    /**
     * 状态名称
     */
    private final String name;

    public static FulfillmentStatusEnum getByStatus(Integer status) {
        for (FulfillmentStatusEnum value : values()) {
            if (value.getStatus().equals(status)) {
                return value;
            }
        }
        return null;
    }

}
